﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GameViewer.Core.Files
{
    public abstract class FileObj
    {
        protected string mFileName;
        protected Archives.FileInfo mFile;
        protected System.IO.Stream mStream;
        protected System.IO.BinaryReader mReader;

        public FileObj(string file)
        {
            mFileName = file;
            mStream = System.IO.File.Open(file, System.IO.FileMode.Open);
            mReader = new System.IO.BinaryReader(mStream);
            this.Initialize();
        }

        public FileObj(Archives.FileInfo file)
        {
            mFile = file;
            mStream = file.Archive.Open(file.FileName);
            mReader = new System.IO.BinaryReader(mStream);
            this.Initialize();
        }

        public abstract void Initialize();
    }
}
